{% if course.type == 'open' or course.type == 'liveOpen' %}
  {% set deleteUrl = path('open_course_manage_material_delete', {courseId:material.courseId,  materialId:material.id}) %}
  {% set downloadUrl = path('open_course_material_download', {courseId:material.courseId, materialId:material.id}) %}
{% else %}
  {% set deleteUrl = path('course_manage_material_delete', {courseId:material.courseId, lessonId:material.lessonId, materialId:material.id}) %}
  {% set downloadUrl = path('course_material_download', {courseId:material.courseId, materialId:material.id}) %}
{% endif %}
<li class="list-group-item clearfix">
  <button class="close delete-btn" type="button" title="{{'删除'|trans}}" data-url="{{ deleteUrl }}">&times;</button>
  {% if material.link %}
    <a href="{{ material.link }}" target="_blank">{{ material.title }}</a>
    <span class="glyphicon glyphicon-new-window text-muted text-sm" title="{{'网络链接资料'|trans}}"></span>
  {% else %}
    <a href="{{ downloadUrl }}">{{ material.title }}</a>
  {% endif %}
</li>